extends Node

# 动画效果管理
var animation_scene = preload("res://animations/animations.tscn")
var animation_scene_obj = null

#凋落物管理
var drop_item_scene = preload("res://drop_items/drop_items.tscn")
var drop_item_scene_obj = null

var duplicate_node =null

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	init_duplicate_node()
	animation_scene_obj = animation_scene.instantiate()#动画场景
	add_child(animation_scene_obj)#添加到场景中
	
	drop_item_scene_obj = drop_item_scene.instantiate()#掉落物场景
	add_child(drop_item_scene_obj)#添加到场景中
	
	
	
	
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass

func init_duplicate_node():
	if duplicate_node!= null:
		duplicate_node.queue_free()
	var node2d = Node2D.new()
	node2d.name ="duplicate_node"
	get_window().add_child.call_deferred(node2d)
	duplicate_node =node2d
	pass
